package kr.hkit.powerjava.chapter23.p603;



public class Consumer implements Runnable {
	private Buffer buffer;
	
		public Consumer(Buffer drop) {
			this.buffer = drop;
	}
	@Override
	public void run() {
		for (int i = 0; i <10; i++){
			int date = buffer.get();
			System.out.println("소비자: " + date + "번 케익을 소비하였습니다." );
			
			try {
				Thread.sleep((int)(Math.random()*100));
			} catch (InterruptedException e) {}
			
		}

	}

}
